<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="node_modules/jquery/dist/jquery.js" type="text/javascript" charset="utf-8"></script>
    <style>
        #box{
            width: 200px;
            height: 100px;
            border: 1px solid red;
        }
        .red{
            background-color: red;
            padding: 20px;
            margin: 20px;
        }
        .able{
            border-radius: 50px;
        }
    </style>
</head>
<body>
<button>添加背景色</button>
<button>删除背景色</button>
<div id="box" ></div>
<script>
    $(function () {
      //添加类
      $("button:first").click(function () {
         $("#box").addClass("red")
      })
      //删除类
       $("button:last").click(function () {
         $("#box").removeClass('red')
       })
    })
</script>
</body>
</html>